<<<<<<< .mine
﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using cestiTest.ServiceReference1;
using System.Net;
using System.ComponentModel;

namespace cestiTest
{
    public partial class _Default : System.Web.UI.Page
    {
        static StockServiceClient client = null;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private void OpenConn()
        {
            if (client == null||client.State!= System.ServiceModel.CommunicationState.Opened )
            {
                client = new StockServiceClient();
                client.ClientCredentials.Windows.ClientCredential.UserName = "test";
                client.ClientCredentials.Windows.ClientCredential.Password = "123";
            }
        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            string username = TextBox1.Text;
            checkExist(username);
        }

        private void checkExist(string username)
        {
            OpenConn();

            DateTime time = DateTime.Now;
            //baseDS.investorDataTable dt=client.GetInvestor_ByCode("A00000004");

            baseDS.investorDataTable dt=new baseDS.investorDataTable();
            baseDS.investorRow row= dt.NewinvestorRow();
            row.code = "A0050";
            row.account = "0050";
            row.firstName = "0050";
            row.email = "A0050@gmail.com";
            dt.AddinvestorRow(row);
            client.UpdateInvestor(ref dt);

            DateTime endtime = DateTime.Now;
            baseDS.investorRow row = dt.FirstOrDefault();

            TimeSpan ts = endtime - time;
            if (row!=null)
            {
                Response.Write("<h1>"+row.firstName+" "+ts.ToString()+"</h1>");
            }
            
            // Use the 'client' variable to call operations on the service.

            // Always close the client.
            client.Close();
        }

    }
}
=======
﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using cestiTest.ServiceReference1;

namespace cestiTest
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string username = TextBox1.Text;
            checkExist(username);
        }

        private void checkExist(string username)
        {
            StockServiceClient client = new StockServiceClient();
            //client.e
            //client
            

            client.ClientCredentials.Windows.ClientCredential.UserName = "test";
            client.ClientCredentials.Windows.ClientCredential.Password = "123";

            DateTime time = DateTime.Now;
            baseDS.investorDataTable dt=client.GetInvestor_ByCode("A00000004");

            DateTime endtime = DateTime.Now;
            baseDS.investorRow row = dt.FirstOrDefault();

            
            TimeSpan ts = endtime - time;
            if (row!=null)
            {
                Response.Write("<h1>"+row.firstName+" "+ts.ToString()+"</h1>");
            }
            
       

            // Use the 'client' variable to call operations on the service.

            // Always close the client.
            client.Close();
        }

    }
}
>>>>>>> .r11
